<?php
defined('IN_XLP') or exit('Access Denied');
$Document = array(
    'pageid'   => 'finance-refund_chart', //页面标示
    'pagename' => '退款报表', //当前页面名称
    'mycss'    => array('../jquery-ui/css/smoothness/jquery-ui-1.10.0.custom.min'), //加载的css样式表
    'myjs'     => array(), //加载的js脚本
    'footerjs' => array('../jquery-ui/js/jquery-ui-1.10.0.custom.min', '../jquery-ui/js/jquery-ui-timepicker-addon'),
    'head'     => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<style>
.tc{text-align:center;}
.red{color:red;}
</style>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
    <!-- main padder -->
    <section class="main padder">
        <div class="clearfix">
            <h4><i class="fa fa-table"></i>退款报表</h4>
            <section class="panel">
                <header class="panel-heading bg-white">订单明细</header>
                <div class="panel-body">

                    <div class="row text-small" style="text-align:center">
                        <form action="<?php echo U('content/finance/refund_chart'); ?>" method="get">
                            <input type="hidden" name="g" value="content">
                            <input type="hidden" name="c" value="finance">
                            <input type="hidden" name="m" value="refund_chart">
                            <div class="col-sm-2 m-b-mini">
                                <label for="">开始时间 <input class="input-sm" name="starttime" id="starttime" size="16" type="text" value="<?php echo $starttime; ?>" readonly></label>
                            </div>
                            <div class="col-sm-2">
                                <label for="">结束时间 <input class="input-sm" name="endtime" id="endtime" size="16" type="text" value="<?php echo $endtime; ?>" readonly></label>
                            </div>
                            <div class="col-sm-1" style="width:4%">
                                <div class="input-group">
                                    <button class="btn btn-sm btn-white" type="submit">确定</button>
                                </div>
                            </div>
                            <div class="col-sm-1">
                                <div class="input-group">
                                    <a class="btn btn-sm btn-white" href="<?php echo U('content/finance/refund_chart',array(),true); ?>">重置</a>
                                </div>
                            </div>
                            <div class="col-sm-1">
                                <div class="input-group">
                                    <a class="btn btn-sm btn-white" href="<?php echo U('content/finance/refund_chart',array('export'=>1),true); ?>">导出CSV</a>
                                </div>
                            </div>
                        </form>
                    </div>
                    
                    <div class="table-responsive">
                        <table class="table table-striped b-t text-small">
                            <thead>
                                <tr>
                                    <th class="tc">订单ID</th>
                                    <th class="tc">订单号</th>
                                    <th class="tc">用户UID</th>
                                    <th class="tc">收货人</th>
                                    <th class="tc">退款金额</th>
                                    <th class="tc">退货数量</th>
                                    <th class="tc">退还运费</th>
                                    <th class="tc">退还结邻币</th>
                                    <th class="tc">退款时间</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($list as $k => $v): ?>
                                <tr>
                                    <td class="tc"><?php echo $v['order_id']; ?></td>
                                    <td class="tc"><?php echo $v['order_sn']; ?></td>
                                    <td class="tc"><?php echo $v['user_id']; ?></td>
                                    <td class="tc"><?php echo $v['recipient']; ?></td>
                                    <td class="tc"><?php echo $v['actual_refund']; ?></td>
                                    <td class="tc"><?php echo $v['actual_return']; ?></td>
                                    <td class="tc"><?php echo $v['refund_shipping']; ?></td>
                                    <td class="tc"><?php echo $v['score_return']; ?></td>
                                    <td class="tc"><?php echo date('Y-m-d H:i:s', $v['finance_time']); ?></td>
                                </tr>
                                <?php endforeach ?>
                            </tbody>
                        </table>
                    </div>

                    <footer class="panel-footer">
                        <div class="row">
                            <div class="col-sm-12 text-right text-center-sm">
                                <?php echo page($total,$page,'', 20, 'page');?>
                            </div>
                        </div>
                    </footer>

                </div>
            </section>
        </div>
    </section>
    <!--/ main padder -->
</section>
<!--/ content -->
<!--主体 结束-->
<script>
$(function () {
    $('#starttime').datetimepicker();
    $('#endtime').datetimepicker();
});
</script>
<?php include getTpl('footer', 'public'); ?>